(defalias 'yes-or-no-p 'y-or-n-p)

;; 快速打开配置文件
(defun open-init-file()
  (interactive)
  (find-file "~/.emacs.d/init.el"))

;; 这一行代码，将函数 open-init-file 绑定到 <f2> 键上
(global-set-key (kbd "<f2>") 'open-init-file)

;; org
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)

;; 删除一行内容
;; 也可以使用 C-a C-k 
;;https://stackoverflow.com/questions/3958528/how-can-i-delete-the-current-line-in-emacs
(global-set-key "\C-cd" 'kill-whole-line)  ;; Sets `C-c d` to `M-x kill-whole-line`

;; windmove: 用于移动窗口
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)

(provide 'init-kbd)
